class ApplicationController < ActionController::Base
  protect_from_forgery
  
  before_filter :beta_authenticate

  #layout :determine_layout

  def after_sign_in_path_for(resource)
    ladders_path
  end

private
  def determine_layout
    current_user ? "private" : "public"
  end

protected
  def beta_authenticate
    authenticate_or_request_with_http_basic do |username, password|
      username == "betauser" && password == "test"
    end
  end

  def admin_required
    unless current_user && current_user.is_admin?
      flash[:error] = "Sorry, you don't have access to that page!"
      redirect_to root_url and return false
    end
  end


end
